<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><title>Hexo相关 | XC's Blog</title><meta name="keywords" content="Hexo"><meta name="author" content="XC's Blog"><meta name="copyright" content="XC's Blog"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="Hexo相关的脚本：上传仓库：将D:\Hexo\Hexo改为自己的博客根目录即可，随后保存为.bat文件1234567@echo offD:cd D:\Hexo\Hexogit add .git commit -m &quot;github action update&quot;git push origin mainpause  指令说明： 第一条指令@echo off，关闭回显第二叫指令D:，"><meta property="og:type" content="article"><meta property="og:title" content="Hexo相关"><meta property="og:url" content="https://www.webxc.ml/post/3032259293/index.html"><meta property="og:site_name" content="XC&#39;s Blog"><meta property="og:description" content="Hexo相关的脚本：上传仓库：将D:\Hexo\Hexo改为自己的博客根目录即可，随后保存为.bat文件1234567@echo offD:cd D:\Hexo\Hexogit add .git commit -m &quot;github action update&quot;git push origin mainpause  指令说明： 第一条指令@echo off，关闭回显第二叫指令D:，"><meta property="og:locale" content="zh_CN"><meta property="og:image" content="https://npm.elemecdn.com/webxc@1.0.0/cover/hexo2.jpg"><meta property="article:published_time" content="2021-01-01T08:00:00.000Z"><meta property="article:modified_time" content="2023-05-04T17:24:22.251Z"><meta property="article:author" content="XC&#39;s Blog"><meta property="article:tag" content="Hexo"><meta name="twitter:card" content="summary"><meta name="twitter:image" content="https://npm.elemecdn.com/webxc@1.0.0/cover/hexo2.jpg"><link rel="shortcut icon" href="https://npm.elemecdn.com/webxc@1.0.0/logo/logo.jpg"><link rel="canonical" href="https://www.webxc.ml/post/3032259293/"><link rel="preconnect" href="//cdn.jsdelivr.net"><link rel="preconnect" href="//busuanzi.ibruce.info"><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://npm.elemecdn.com/@fortawesome/fontawesome-free@6.2.0/css/all.min.css" media="print" onload='this.media="all"'><link rel="stylesheet" href="https://npm.elemecdn.com/node-snackbar/dist/snackbar.min.css" media="print" onload='this.media="all"'><link rel="stylesheet" href="https://npm.elemecdn.com/@fancyapps/ui/dist/fancybox.css" media="print" onload='this.media="all"'><script>const GLOBAL_CONFIG={root:"/",algolia:void 0,localSearch:{path:"/search.xml",preload:!1,languages:{hits_empty:"找不到您查询的内容：${query}"}},translate:void 0,noticeOutdate:void 0,highlight:{plugin:"highlighjs",highlightCopy:!0,highlightLang:!0,highlightHeightLimit:!1},copy:{success:"吾辈宣布,你的剪切板已被占领",error:"呀~复制失败,请在尝试下",noSupport:"对不起,你的浏览器不支持"},relativeDate:{homepage:!1,post:!1},runtime:"",date_suffix:{just:"刚刚",min:"分钟前",hour:"小时前",day:"天前",month:"个月前"},copyright:{limitCount:60,languages:{author:"作者: XC's Blog",link:"链接: ",source:"来源: XC's Blog",info:"著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。"}},lightbox:"fancybox",Snackbar:{chs_to_cht:"您已切换为繁体",cht_to_chs:"您已切换为简体",day_to_night:"您已切换为深色主题",night_to_day:"您已切换为浅色主题",bgLight:"#3b70fc",bgDark:"#121212",position:"bottom-center"},source:{justifiedGallery:{js:"https://npm.elemecdn.com/flickr-justified-gallery/dist/fjGallery.min.js",css:"https://npm.elemecdn.com/flickr-justified-gallery/dist/fjGallery.css"}},isPhotoFigcaption:!1,islazyload:!0,isAnchor:!0}</script><script id="config-diff">var GLOBAL_CONFIG_SITE={title:"Hexo相关",isPost:!0,isHome:!1,isHighlightShrink:!1,isToc:!0,postUpdate:"2023-05-04 17:24:22"}</script><noscript><style>#nav{opacity:1}.justified-gallery img{opacity:1}#post-meta time,#recent-posts time{display:inline!important}</style></noscript><script>(e=>{e.saveToLocal={set:function(e,t,o){if(0===o)return;const n=864e5*o,a={value:t,expiry:(new Date).getTime()+n};localStorage.setItem(e,JSON.stringify(a))},get:function(e){const t=localStorage.getItem(e);if(!t)return;const o=JSON.parse(t);if(!((new Date).getTime()>o.expiry))return o.value;localStorage.removeItem(e)}},e.getScript=e=>new Promise(((t,o)=>{const n=document.createElement("script");n.src=e,n.async=!0,n.onerror=o,n.onload=n.onreadystatechange=function(){const e=this.readyState;e&&"loaded"!==e&&"complete"!==e||(n.onload=n.onreadystatechange=null,t())},document.head.appendChild(n)})),e.activateDarkMode=function(){document.documentElement.setAttribute("data-theme","dark"),null!==document.querySelector('meta[name="theme-color"]')&&document.querySelector('meta[name="theme-color"]').setAttribute("content","#0d0d0d")},e.activateLightMode=function(){document.documentElement.setAttribute("data-theme","light"),null!==document.querySelector('meta[name="theme-color"]')&&document.querySelector('meta[name="theme-color"]').setAttribute("content","#ffffff")};const t=saveToLocal.get("theme");"dark"===t?activateDarkMode():"light"===t&&activateLightMode();const o=saveToLocal.get("aside-status");void 0!==o&&("hide"===o?document.documentElement.classList.add("hide-aside"):document.documentElement.classList.remove("hide-aside"));/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)&&document.documentElement.classList.add("apple")})(window)</script><link rel="stylesheet" href="https://cdn1.tianli0.top/gh/web-xc/My-blog-CSS/mgi.css"><link rel="stylesheet" href="https://cdn1.tianli0.top/gh/web-xc/My-blog-CSS/mg111.css"><link rel="stylesheet" href="https://npm.elemecdn.com/webxc@1.0.16/css/mg2.css"><link rel="stylesheet" href="https://npm.elemecdn.com/webxc@1.0.11/css/styless.css"><link rel="stylesheet" href="https://npm.elemecdn.com/webxc@1.0.11/css/styles.css"><link rel="stylesheet" href="https://npm.elemecdn.com/webxc@1.0.11/css/font.css"><link rel="stylesheet" href="https://npm.elemecdn.com/webxc@1.0.15/css/font2.css"><link rel="stylesheet" href="https://npm.elemecdn.com/webxc@1.0.12/css/swiper/swiper.min.css" media="print" onload='this.media="all"'><link rel="stylesheet" href="https://npm.elemecdn.com/webxc@1.0.12/css/swiper/swiperstyle.css" media="print" onload='this.media="all"'><meta name="generator" content="Hexo 6.3.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://npm.elemecdn.com/webxc@1.0.0/logo/logo.jpg" onerror='onerror=null,src="https://npm.elemecdn.com/webxc@1.0.2/banner/404.gif"' alt="avatar"></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">74</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">22</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">22</div></a></div><hr><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw iconfont icon-shouye"></i> <span>首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw iconfont icon-shijian"></i> <span>时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw iconfont icon-biaoqian"></i> <span>标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw iconfont icon-fenlei"></i> <span>分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw iconfont icon-lianxiwomen"></i> <span>友联</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw iconfont icon-iconzhengli-"></i> <span>关于</span></a></div><div class="menus_item"><a class="site-page group hide" href="javascript:void(0);"><i class="fa-fw iconfont icon-a-wangzhanchaojilianjiehulianwang"></i> <span>推荐</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" target="_blank" rel="noopener" href="http://www.inode.club/"><i class="fa-fw fa-sharp fa-solid fa-square-rss"></i> <span>程序员指南</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="http://ife.baidu.com/"><i class="fa-fw fa-brands fa-vuejs"></i> <span>前端技术学园</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://www.yuque.com/tademanong/ag7q4n"><i class="fa-fw fa-solid fa-users"></i> <span>前端技术圈</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://www.code-nav.cn/"><i class="fa-fw fa-solid fa-shop"></i> <span>编程导航</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://q.shanyue.tech/"><i class="fa-fw fa-brands fa-square-js"></i> <span>每日一题</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://fanyouf.gitee.io/u1word/#/h5"><i class="fa-fw fa-solid fa-headphones"></i> <span>前端必会单词</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://site.51git.cn/render/gonav/4.html"><i class="fa-fw iconfont icon-wangzhandingzhi"></i> <span>网址导航</span></a></li><li><a class="site-page child" href="https://www.webxc.ml/music/"><i class="fa-fw iconfont icon-musical-note"></i> <span>音乐解锁</span></a></li></ul></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image:url('https://npm.elemecdn.com/webxc@1.0.0/cover/hexo2.jpg')"><nav id="nav"><span id="blog_name"><div class="back-home-button" tabindex="-1"><i class="back-home-button-icon fas fa-grip-vertical"></i><div class="back-menu-list-groups"><div class="back-menu-list-group"><div class="back-menu-list-title">项目</div><div class="back-menu-list"><a class="back-menu-item" href="/" title="前往博客主页" target="_blank" one-link-mark="yes"><img class="back-menu-item-icon" src="https://npm.elemecdn.com/webxc@1.0.0/logo/logo.jpg"><span class="back-menu-item-text">主站</span></a><a class="back-menu-item" href="https://e.webxc.tk/" rel="external nofollow" title="前往学习笔记" target="_blank" one-link-mark="yes"><img class="back-menu-item-icon" src="https://npm.elemecdn.com/webxc@1.0.0/logo/logo.jpg"><span class="back-menu-item-text">学习笔记</span></a><a class="back-menu-item" href="https://v.webxc.tk/" rel="external nofollow" title="VuePress学习文档" target="_blank" one-link-mark="yes"><img class="back-menu-item-icon" src="https://npm.elemecdn.com/webxc@1.0.0/logo/logo.jpg"><span class="back-menu-item-text">VuePress文档</span></a><a class="back-menu-item" href="https://b.webxc.tk/" rel="external nofollow" title="旧站Hexo" target="_blank" one-link-mark="yes"><img class="back-menu-item-icon" src="https://npm.elemecdn.com/webxc@1.0.0/logo/logo.jpg"><span class="back-menu-item-text">旧站Hexo</span></a><a class="back-menu-item" href="https://gridea.webxc.ml/" rel="external nofollow" title="Gridea笔记" target="_blank" one-link-mark="yes"><img class="back-menu-item-icon" src="https://npm.elemecdn.com/webxc@1.0.0/logo/logo.jpg"><span class="back-menu-item-text">Gridea笔记</span></a><a class="back-menu-item" href="https://c.webxc.tk/" rel="external nofollow" title="魔改Hexo" target="_blank" one-link-mark="yes"><img class="back-menu-item-icon" src="https://npm.elemecdn.com/webxc@1.0.0/logo/logo.jpg"><span class="back-menu-item-text">魔改Hexo</span></a></div></div><div class="back-menu-list-group"><div class="back-menu-list-title">博客镜像</div><div class="back-menu-list"><a class="back-menu-item" href="https://blog.webxc.ml/" title="Vercel镜像" target="_blank" rel="noopener nofollow" one-link-mark="yes"><img class="back-menu-item-icon" src="https://npm.elemecdn.com/webxc@1.0.0/logo/logo.jpg"><span class="back-menu-item-text">Vercel镜像</span></a><a class="back-menu-item" href="https://webxc.tk/" title="Netlify镜像" target="_blank" rel="noopener nofollow" one-link-mark="yes"><img class="back-menu-item-icon" src="https://npm.elemecdn.com/webxc@1.0.0/logo/logo.jpg"><span class="back-menu-item-text">Netlify镜像</span></a><a class="back-menu-item" href="https://web-xc.gitee.io/" title="Gitee镜像" target="_blank" rel="noopener nofollow" one-link-mark="yes"><img class="back-menu-item-icon" src="https://npm.elemecdn.com/webxc@1.0.0/logo/logo.jpg"><span class="back-menu-item-text">Gitee镜像</span></a><a class="back-menu-item" href="https://cf.webxc.ml/" title="Cloudflare镜像" target="_blank" rel="noopener nofollow" one-link-mark="yes"><img class="back-menu-item-icon" src="https://npm.elemecdn.com/webxc@1.0.0/logo/logo.jpg"><span class="back-menu-item-text">Cloudflare镜像</span></a><a class="back-menu-item" href="https://render.webxc.ml/" title="Render镜像" target="_blank" rel="noopener nofollow" one-link-mark="yes"><img class="back-menu-item-icon" src="https://npm.elemecdn.com/webxc@1.0.0/logo/logo.jpg"><span class="back-menu-item-text">Render镜像</span></a></div></div></div></div><a id="site-name" href="/"><div class="title">XC's Blog</div><i class="fa-solid fa-house"></i></a></span><div class="mask-name-container"><center id="name-container"><a id="page-name" href="javascript:btf.scrollToDest(0, 500)">PAGE_NAME</a></center></div><div id="menus"><div class="nav-button" id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i> <span>搜索</span></a></div><div class="nav-button" id="darkmode_navswitch"><a class="darkmode_switchbutton" type="button" title="浅色和深色模式转换" onclick="switchDarkMode()"><i class="fas fa-adjust"></i></a></div><div class="nav-button" id="nav-totop"><a class="totopbtn"><i class="fas fa-arrow-up"></i><span id="percent" onclick="btf.scrollToDest(0,500)">0</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw iconfont icon-shouye"></i> <span>首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw iconfont icon-shijian"></i> <span>时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw iconfont icon-biaoqian"></i> <span>标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw iconfont icon-fenlei"></i> <span>分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw iconfont icon-lianxiwomen"></i> <span>友联</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw iconfont icon-iconzhengli-"></i> <span>关于</span></a></div><div class="menus_item"><a class="site-page group hide" href="javascript:void(0);"><i class="fa-fw iconfont icon-a-wangzhanchaojilianjiehulianwang"></i> <span>推荐</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" target="_blank" rel="noopener" href="http://www.inode.club/"><i class="fa-fw fa-sharp fa-solid fa-square-rss"></i> <span>程序员指南</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="http://ife.baidu.com/"><i class="fa-fw fa-brands fa-vuejs"></i> <span>前端技术学园</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://www.yuque.com/tademanong/ag7q4n"><i class="fa-fw fa-solid fa-users"></i> <span>前端技术圈</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://www.code-nav.cn/"><i class="fa-fw fa-solid fa-shop"></i> <span>编程导航</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://q.shanyue.tech/"><i class="fa-fw fa-brands fa-square-js"></i> <span>每日一题</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://fanyouf.gitee.io/u1word/#/h5"><i class="fa-fw fa-solid fa-headphones"></i> <span>前端必会单词</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://site.51git.cn/render/gonav/4.html"><i class="fa-fw iconfont icon-wangzhandingzhi"></i> <span>网址导航</span></a></li><li><a class="site-page child" href="https://www.webxc.ml/music/"><i class="fa-fw iconfont icon-musical-note"></i> <span>音乐解锁</span></a></li></ul></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">Hexo相关</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2021-01-01T08:00:00.000Z" title="发表于 2021-01-01 08:00:00">2021-01-01</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2023-05-04T17:24:22.251Z" title="更新于 2023-05-04 17:24:22">2023-05-04</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/Hexo/">Hexo</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span data-flag-title="Hexo相关"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="twikoo_visitors"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h3 id="Hexo相关的脚本："><a href="#Hexo相关的脚本：" class="headerlink" title="Hexo相关的脚本："></a>Hexo相关的脚本：</h3><h4 id="上传仓库："><a href="#上传仓库：" class="headerlink" title="上传仓库："></a>上传仓库：</h4><h5 id="将D-Hexo-Hexo改为自己的博客根目录即可，随后保存为-bat文件"><a href="#将D-Hexo-Hexo改为自己的博客根目录即可，随后保存为-bat文件" class="headerlink" title="将D:\Hexo\Hexo改为自己的博客根目录即可，随后保存为.bat文件"></a>将<code>D:\Hexo\Hexo</code>改为自己的博客根目录即可，随后保存为<code>.bat文件</code></h5><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">@echo off</span><br><span class="line">D:</span><br><span class="line">cd D:\Hexo\Hexo</span><br><span class="line">git add .</span><br><span class="line">git commit -m &quot;github action update&quot;</span><br><span class="line">git push origin main</span><br><span class="line">pause</span><br></pre></td></tr></table></figure><h5 id="指令说明："><a href="#指令说明：" class="headerlink" title="指令说明："></a>指令说明：</h5><ol><li>第一条指令<code>@echo off</code>，关闭回显<br>第二叫指令<code>D:</code>，切换到博客站点目录所在的盘符，我这里是D盘<br>第三条指令<code>cd D:\Hexo\Hexo</code>，进入站点目录，我这里是<code>D:\Hexo\Hexo</code><br>第四条指令<code>git add -A commit -m &#39;test&#39; git push</code>推送到github<br>第五条指令<code>pause</code>,暂停</li></ol><h4 id="刷新dns："><a href="#刷新dns：" class="headerlink" title="刷新dns："></a>刷新dns：</h4><h5 id="由于某些情况可能暂时无法访问github，需要更改Hosts，更改完需要刷新DNS才会生效，保存为-bat文件"><a href="#由于某些情况可能暂时无法访问github，需要更改Hosts，更改完需要刷新DNS才会生效，保存为-bat文件" class="headerlink" title="由于某些情况可能暂时无法访问github，需要更改Hosts，更改完需要刷新DNS才会生效，保存为.bat文件"></a>由于某些情况可能暂时无法访问<code>github</code>，需要更改<code>Hosts</code>，更改完需要刷新<code>DNS</code>才会生效，保存为<code>.bat文件</code></h5><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">@echo off</span><br><span class="line">ipconfig /flushdns</span><br><span class="line">pause</span><br></pre></td></tr></table></figure><h5 id="新建文章："><a href="#新建文章：" class="headerlink" title="新建文章："></a>新建文章：</h5><h5 id="打开后输入文章名即可新建文章，将D-Hexo-Hexo更改为自己的博客根目录即可，保存为-sh文件"><a href="#打开后输入文章名即可新建文章，将D-Hexo-Hexo更改为自己的博客根目录即可，保存为-sh文件" class="headerlink" title="打开后输入文章名即可新建文章，将D:\Hexo\Hexo更改为自己的博客根目录即可，保存为.sh文件"></a>打开后输入文章名即可新建文章，将<code>D:\Hexo\Hexo</code>更改为自己的博客根目录即可，保存为<code>.sh</code>文件</h5><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">set -e</span><br><span class="line">cd &quot;D:\Hexo\Hexo&quot;</span><br><span class="line">read -p &quot;文章名称: &quot; title</span><br><span class="line">hexo new $layout $title</span><br><span class="line">cd -</span><br></pre></td></tr></table></figure><h4 id="本地预览："><a href="#本地预览：" class="headerlink" title="本地预览："></a>本地预览：</h4><h5 id="将D-Hexo-Hexo更改为自己的博客根目录即可，保存为-sh文件"><a href="#将D-Hexo-Hexo更改为自己的博客根目录即可，保存为-sh文件" class="headerlink" title="将D:\Hexo\Hexo更改为自己的博客根目录即可，保存为.sh文件"></a>将<code>D:\Hexo\Hexo</code>更改为自己的博客根目录即可，保存为<code>.sh</code>文件</h5><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">cd &quot;D:\Hexo\Hexo&quot;</span><br><span class="line">hexo S</span><br></pre></td></tr></table></figure><h4 id="清理缓存："><a href="#清理缓存：" class="headerlink" title="清理缓存："></a>清理缓存：</h4><h5 id="将D-Hexo-Hexo更改为自己的博客根目录即可，保存为-sh文件-1"><a href="#将D-Hexo-Hexo更改为自己的博客根目录即可，保存为-sh文件-1" class="headerlink" title="将D:\Hexo\Hexo更改为自己的博客根目录即可，保存为.sh文件"></a>将<code>D:\Hexo\Hexo</code>更改为自己的博客根目录即可，保存为<code>.sh</code>文件</h5><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">cd &quot;D:\Hexo\Hexo&quot;</span><br><span class="line">hexo clean</span><br></pre></td></tr></table></figure><h4 id="根目录："><a href="#根目录：" class="headerlink" title="根目录："></a>根目录：</h4><h5 id="如果要运行指令需要到跟目录右键打开git，简化操作，一键cd到更目录。将D-Hexo-Hexo更改为自己的博客根目录即可，保存为-sh文件"><a href="#如果要运行指令需要到跟目录右键打开git，简化操作，一键cd到更目录。将D-Hexo-Hexo更改为自己的博客根目录即可，保存为-sh文件" class="headerlink" title="如果要运行指令需要到跟目录右键打开git，简化操作，一键cd到更目录。将D:\Hexo\Hexo更改为自己的博客根目录即可，保存为.sh文件"></a>如果要运行指令需要到<code>跟目录</code>右键打开<code>git</code>，简化操作，一键cd到更目录。将<code>D:\Hexo\Hexo</code>更改为自己的博客根目录即可，保存为<code>.sh</code>文件</h5><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">cd &quot;D:\Hexo\Hexo&quot;</span><br><span class="line">exec /bin/bash</span><br></pre></td></tr></table></figure><h2 id="hexo-butterfly美化："><a href="#hexo-butterfly美化：" class="headerlink" title="hexo-butterfly美化："></a>hexo-butterfly美化：</h2><h3 id="樱花飘落背景"><a href="#樱花飘落背景" class="headerlink" title="樱花飘落背景"></a>樱花飘落背景</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">cd theme/Butterfly/source/js</span><br><span class="line">wget https://yremp.live/wp-content/uploads/resource/js/sakura.js</span><br></pre></td></tr></table></figure><p>把下载好的Js文件放在<code>theme/Butterfly/source/js</code>文件夹下<br><code>/Butterfly/layout/includes</code>文件夹下找到<code>head.pug</code>文件，在最后引入</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">if theme.sakura.enable</span><br><span class="line">  script(src=&quot;/js/sakura.js&quot;)</span><br></pre></td></tr></table></figure><p>在主题的主配置文件加入<code>Butterfly/_config.yml</code></p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"># 页面樱花飘落动效</span><br><span class="line">sakura:</span><br><span class="line">  enable: true</span><br></pre></td></tr></table></figure><h3 id="浏览器标题恶搞"><a href="#浏览器标题恶搞" class="headerlink" title="浏览器标题恶搞"></a>浏览器标题恶搞</h3><p>在<code>theme/Butterfly/source/js</code>文件夹下添加<code>crash_cheat.js</code>文件<br>填入以下内容<code>记得要修改你喜欢的标题</code></p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">var OriginTitle = document.title;</span><br><span class="line"> var titleTime;</span><br><span class="line"> document.addEventListener(&#x27;visibilitychange&#x27;, function () &#123;</span><br><span class="line">     if (document.hidden) &#123;</span><br><span class="line">         $(&#x27;[rel=&quot;icon&quot;]&#x27;).attr(&#x27;href&#x27;, &quot;/joke.ico&quot;);</span><br><span class="line">         document.title = &#x27;看不见我🙈~看不见我🙈~&#x27;;</span><br><span class="line">         clearTimeout(titleTime);</span><br><span class="line">     &#125;</span><br><span class="line">     else &#123;</span><br><span class="line">         $(&#x27;[rel=&quot;icon&quot;]&#x27;).attr(&#x27;href&#x27;, &quot;/favicon.ico&quot;);</span><br><span class="line">         document.title = &#x27; ( ๑•̀ㅂ•́) ✧被发现了～&#x27;;</span><br><span class="line">         titleTime = setTimeout(function () &#123;</span><br><span class="line">             document.title = OriginTitle;</span><br><span class="line">         &#125;, 2000);</span><br><span class="line">     &#125;</span><br><span class="line"> &#125;);</span><br></pre></td></tr></table></figure><p>在<code>Butterfly/layout/includes/layout.pug</code>中添加以下代码来引入</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">script(type=&#x27;text/javascript&#x27;, src=&#x27;/js/crash_cheat.js&#x27;)</span><br></pre></td></tr></table></figure><h4 id="注意"><a href="#注意" class="headerlink" title="注意"></a>注意</h4><p>因更新最新主题版本出现以下报错</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">JQuery - $ is not defined</span><br></pre></td></tr></table></figure><p>解决方式</p><p>引入以下js</p><p><a target="_blank" rel="noopener" href="https://cdn.jsdelivr.net/gh/weilain/cdn-photo/js/jquery.min.js">https://cdn.jsdelivr.net/gh/weilain/cdn-photo/js/jquery.min.js</a></p><h4 id="示例"><a href="#示例" class="headerlink" title="示例"></a>示例</h4><p>在<code>inject:</code> -&gt; <code>bottom:</code></p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">- &lt;script src=&quot;https://cdn.jsdelivr.net/gh/weilain/cdn-photo/js/jquery.min.js&quot;&gt;&lt;/script&gt;</span><br></pre></td></tr></table></figure><p>解决我了遇到的问题！</p><h3 id="添加标签云"><a href="#添加标签云" class="headerlink" title="添加标签云"></a>添加标签云</h3><p>使用命令进行安装插件</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cnpm install hexo-tag-cloud --save</span><br></pre></td></tr></table></figure><p>打开<code>Butterfly/layout/includes/widget/card_tags.pug</code>文件，用下面内容将其替换掉，最好把之前的文件备份一下,防止后悔</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">if site.tags.length</span><br><span class="line">  .card-widget.card-tags</span><br><span class="line">    .card-content</span><br><span class="line">      .item-headline</span><br><span class="line">        i.fa.fa-tags(aria-hidden=&quot;true&quot;)</span><br><span class="line">        span= _p(&#x27;aside.card_tags&#x27;)</span><br><span class="line">        script(type=&quot;text/javascript&quot; charset=&quot;utf-8&quot; src=&quot;/js/tagcloud.js&quot;)</span><br><span class="line">        script(type=&quot;text/javascript&quot; charset=&quot;utf-8&quot; src=&quot;/js/tagcanvas.js&quot;)</span><br><span class="line">        #myCanvasContainer.widget.tagcloud(align=&#x27;center&#x27;)</span><br><span class="line">          canvas#resCanvas(width=&#x27;200&#x27;, height=&#x27;200&#x27;, style=&#x27;width=100%&#x27;)</span><br><span class="line">            != tagcloud()</span><br><span class="line">          != tagcloud(&#123;min_font: 16, max_font: 24, amount: 50, color: true, start_color: &#x27;#999&#x27;, end_color: &#x27;#99a9bf&#x27;&#125;)</span><br></pre></td></tr></table></figure><h3 id="添加个性化板娘"><a href="#添加个性化板娘" class="headerlink" title="添加个性化板娘"></a>添加个性化板娘</h3><blockquote><p>由<a target="_blank" rel="noopener" href="https://github.com/stevenjoezhang/live2d-widget">stevenjoezhang</a> 魔改项目<br>最简单引用方式在<code>Butterfly/_config.yml</code>中<code>inject</code>添加</p></blockquote><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">inject:</span><br><span class="line">   head:</span><br><span class="line">     - &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/npm/font-awesome/css/font-awesome.min.css&quot;&gt;</span><br><span class="line">   bottom:</span><br><span class="line">     - &lt;script src=&quot;https://cdn.jsdelivr.net/gh/stevenjoezhang/live2d-widget@latest/autoload.js&quot;&gt;&lt;/script&gt;</span><br></pre></td></tr></table></figure><h3 id="添加访客地图"><a href="#添加访客地图" class="headerlink" title="添加访客地图"></a>添加访客地图</h3><p>前往 <a target="_blank" rel="noopener" href="https://clustrmaps.com/">clustrmaps</a> 网站注册一个帐号</p><p>找到 <code>Free Tools</code> 下面的 <code>Website Widget</code>, 点击 <code>Get Map Widget</code></p><p>输入你的博客网址，点击 <code>Next</code></p><p>根据你自己的喜好选择样式 <code>Map widget</code> 或 <code>Globe Widget</code></p><p>找到如下代码，记住 <code>src (****** 的部分)</code>:</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&lt;script type=&quot;text/javascript&quot; id=&quot;clstr_globe&quot; src=&quot;**********************&quot;&gt;</span><br></pre></td></tr></table></figure><p>在 <code>themes/butterfly/layout/includes/widget/</code> 文件夹新建 <code>card_map.pug</code> 文件，文件内容如下:</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">.card-widget.card-map</span><br><span class="line">  .card-content</span><br><span class="line">    .item-headline</span><br><span class="line">      i.fa.fa-globe-asia(aria-hidden=&quot;true&quot;)</span><br><span class="line">      span= _p(&#x27;aside.card_map&#x27;)</span><br><span class="line">    script#clstr_globe(type=&quot;text/javascript&quot; defer=&quot;defer&quot; src=&quot;此处填入你自己的代码&quot;)</span><br></pre></td></tr></table></figure><p>编辑 <code>themes/butterfly/layout/includes/widget/index.pug</code> 文件，在你想要显示的位置插入以下代码:</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">if theme.aside.card_map</span><br><span class="line">        !=partial(&#x27;includes/widget/card_map&#x27;, &#123;&#125;, &#123;cache:theme.fragment_cache&#125;)</span><br></pre></td></tr></table></figure><blockquote><p>注意格式</p></blockquote><p>编辑 <code>butterfly/_config.yml</code> 文件，在 <code>card_webinfo</code> 下面添加一行 <code>card_map: true</code></p><p>编辑 <code>themes/Butterfly/languages/zh-CN.yml</code> 文件 (请根据你的网站语言选择)，找到 <code>aside</code> 下对应格式添加 <code>card_map: 访客地图</code> (后面的文本可自定义)</p><p>如果不想显示，直接把 <code>butterfly/_config.yml</code> 文件的 <code>card_map: true</code> 改为 <code>card_map: false</code> 即可</p><h3 id="页脚跳动的♥"><a href="#页脚跳动的♥" class="headerlink" title="页脚跳动的♥"></a>页脚跳动的♥</h3><p>编辑博客根目录<code>themes/Butterfly/layout/includes/footer.pug</code>文件，将</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">.copyright!= `&amp;copy;$&#123;theme.footer.owner.since&#125; - $&#123;nowYear&#125; By $&#123;config.author&#125;`</span><br></pre></td></tr></table></figure><p>改为</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">.copyright!= `&amp;copy;$&#123;theme.footer.owner.since&#125; - $&#123;nowYear&#125; &lt;i id=&quot;heartbeat&quot; class=&quot;fa fas fa-heartbeat&quot;&gt;&lt;/i&gt;  $&#123;config.author&#125;`</span><br></pre></td></tr></table></figure><p>将</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">.copyright!= `&amp;copy;$&#123;nowYear&#125; By $&#123;config.author&#125;`</span><br></pre></td></tr></table></figure><p>改为</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">.copyright!= `&amp;copy;$&#123;nowYear&#125; &lt;i id=&quot;heartbeat&quot; class=&quot;fa fas fa-heartbeat&quot;&gt;&lt;/i&gt; $&#123;config.author&#125;`</span><br></pre></td></tr></table></figure><p>编辑<code>butterfly.yml</code>文件</p><p>在<code>inject-&gt;head</code>下面添加如下内容：</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">- &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/gh/HCLonely/images@master/others/heartbeat.min.css&quot;&gt;</span><br></pre></td></tr></table></figure><h3 id="Butterfly加载动画修改"><a href="#Butterfly加载动画修改" class="headerlink" title="Butterfly加载动画修改"></a>Butterfly加载动画修改</h3><p>添加配置文件</p><p>在目录<code>themes/butterfly/layout/includes/loading</code>下添加<code>loaded.ejs</code>文件，代码如下</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br></pre></td><td class="code"><pre><span class="line">&lt;% if (theme.preloader.enable) &#123; %&gt;</span><br><span class="line">&lt;div id=&#x27;loader&#x27;&gt;</span><br><span class="line">    &lt;% if(theme.preloader.layout == &#x27;gear&#x27; ) &#123;%&gt;</span><br><span class="line">    &lt;div class=&quot;outer_box&quot;&gt;</span><br><span class="line">    &lt;div class=&#x27;loader_overlay&#x27;&gt;&lt;/div&gt;</span><br><span class="line">    &lt;div class=&#x27;loader_cogs&#x27;&gt;</span><br><span class="line">        &lt;div class=&#x27;loader_cogs__top&#x27;&gt;</span><br><span class="line">            &lt;div class=&#x27;top_part&#x27;&gt;&lt;/div&gt;</span><br><span class="line">            &lt;div class=&#x27;top_part&#x27;&gt;&lt;/div&gt;</span><br><span class="line">            &lt;div class=&#x27;top_part&#x27;&gt;&lt;/div&gt;</span><br><span class="line">            &lt;div class=&#x27;top_hole&#x27;&gt;&lt;/div&gt;</span><br><span class="line">        &lt;/div&gt;</span><br><span class="line">        &lt;div class=&#x27;loader_cogs__left&#x27;&gt;</span><br><span class="line">            &lt;div class=&#x27;left_part&#x27;&gt;&lt;/div&gt;</span><br><span class="line">            &lt;div class=&#x27;left_part&#x27;&gt;&lt;/div&gt;</span><br><span class="line">            &lt;div class=&#x27;left_part&#x27;&gt;&lt;/div&gt;</span><br><span class="line">            &lt;div class=&#x27;left_hole&#x27;&gt;&lt;/div&gt;</span><br><span class="line">        &lt;/div&gt;</span><br><span class="line">        &lt;div class=&#x27;loader_cogs__bottom&#x27;&gt;</span><br><span class="line">            &lt;div class=&#x27;bottom_part&#x27;&gt;&lt;/div&gt;</span><br><span class="line">            &lt;div class=&#x27;bottom_part&#x27;&gt;&lt;/div&gt;</span><br><span class="line">            &lt;div class=&#x27;bottom_part&#x27;&gt;&lt;/div&gt;</span><br><span class="line">            &lt;div class=&#x27;bottom_hole&#x27;&gt;&lt;/div&gt;</span><br><span class="line">        &lt;/div&gt;</span><br><span class="line">        &lt;p style=&quot;text-align:center&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;loading...&lt;/p&gt;</span><br><span class="line">    &lt;/div&gt;</span><br><span class="line">    &lt;/div&gt;</span><br><span class="line">  &lt;% &#125; else if(theme.preloader.layout == &#x27;spinner-box&#x27;) &#123; %&gt;</span><br><span class="line">    &lt;div class=&quot;loading-left-bg&quot;&gt;&lt;/div&gt;</span><br><span class="line">    &lt;div class=&quot;loading-right-bg&quot;&gt;&lt;/div&gt;</span><br><span class="line">    &lt;div class=&quot;spinner-box&quot;&gt;</span><br><span class="line">        &lt;div class=&quot;configure-border-1&quot;&gt;</span><br><span class="line">            &lt;div class=&quot;configure-core&quot;&gt;&lt;/div&gt;</span><br><span class="line">        &lt;/div&gt;</span><br><span class="line">        &lt;div class=&quot;configure-border-2&quot;&gt;</span><br><span class="line">            &lt;div class=&quot;configure-core&quot;&gt;&lt;/div&gt;</span><br><span class="line">        &lt;/div&gt;</span><br><span class="line">        &lt;div class=&quot;loading-word&quot;&gt;加载中...&lt;/div&gt;</span><br><span class="line">    &lt;/div&gt;</span><br><span class="line">  &lt;% &#125; %&gt;</span><br><span class="line">&lt;/div&gt;</span><br><span class="line"></span><br><span class="line">&lt;script&gt;</span><br><span class="line">  var endLoading = function () &#123;</span><br><span class="line">    document.body.style.overflow = &#x27;auto&#x27;;</span><br><span class="line">    document.getElementById(&#x27;loader&#x27;).classList.add(&quot;loading&quot;);</span><br><span class="line">  &#125;</span><br><span class="line">  window.addEventListener(&#x27;load&#x27;,endLoading);</span><br><span class="line">&lt;/script&gt;</span><br><span class="line">&lt;% &#125; %&gt;</span><br></pre></td></tr></table></figure><h3 id="引入样式文件"><a href="#引入样式文件" class="headerlink" title="引入样式文件"></a>引入样式文件</h3><ul><li>&#96;&#96;&#96;<br>spinner-box<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">风格样式文件 及默认</span><br><span class="line"></span><br></pre></td></tr></table></figure>butterfly<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">主题加载：</span><br><span class="line"></span><br></pre></td></tr></table></figure><ul><li><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/zyoushuo/Blog@latest/hexo/css/loading_style_1.css"><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">- gear风格样式文件</span><br><span class="line"></span><br></pre></td></tr></table></figure></li></ul></li><li><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/zyoushuo/Blog@latest/hexo/css/loading_style_2.css"><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">将上面两行代码加到主题目录`_config _yml`下的`inject`中</span><br><span class="line"></span><br><span class="line">引入到页面</span><br><span class="line"></span><br><span class="line">找到 `themes/butterfly/layout/includes/`下的文件`layout.pug`,将代码</span><br><span class="line"></span><br></pre></td></tr></table></figure>if theme.preloader !=partial('includes/loading/loading', {}, {cache:theme.fragment_cache})<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">替换为</span><br><span class="line"></span><br></pre></td></tr></table></figure>if theme.preloader !=partial('includes/loading/loaded.ejs', {}, {cache:theme.fragment_cache})<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">开启加载</span><br><span class="line"></span><br><span class="line">主题目录`_config _yml`中的</span><br><span class="line"></span><br></pre></td></tr></table></figure>preloader: true<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">替换为</span><br><span class="line"></span><br></pre></td></tr></table></figure>preloader: enable: true layout: gear # gear, spinner-box 两种样式<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">### Hexo 博客之优雅使用阿里 iconfont 图标：</span><br><span class="line"></span><br><span class="line">Font Awesome 无论是 v4 还是 v5 图标都有一些局限性。因此不少小伙伴想到了使用阿里 iconfont 图标。然而很多小伙伴并不是前端这个专业，可能对使用图标存在一定的问题。</span><br><span class="line"></span><br><span class="line">因此创作这篇水文，帮助小伙伴解决无法引入阿里 iconfont 图标的问题。</span><br><span class="line"></span><br><span class="line">什么人能够使用？</span><br><span class="line"></span><br><span class="line">理论上来说任何主题任何驱动都可以。只要你的网页还是 HTML+CSS。</span><br><span class="line"></span><br><span class="line">引入并不是什么难事，这篇文章只是给小白看的，有相关经验或者大佬可以直接关掉这篇水文了。</span><br><span class="line"></span><br><span class="line">引入前的准备</span><br><span class="line"></span><br><span class="line">能够登录阿里 iconfont</span><br><span class="line"></span><br><span class="line">认识汉字及部分单词（content、class 等）</span><br><span class="line"></span><br><span class="line">具备一定的前端知识：了解什么是标签</span><br><span class="line"></span><br><span class="line">具备一定的前端知识：能够使用开发者工具</span><br><span class="line"></span><br><span class="line">具备一定的前端知识：能够找到相应的标签</span><br><span class="line"></span><br><span class="line">具备一定的前端知识：明白 css 的语法</span><br><span class="line"></span><br><span class="line">其他说明</span><br><span class="line"></span><br><span class="line">此教程理论上可以在任意主题（需自己具备一定的能力）使用，此主题只以 butterfly（版本：2.3.5）主题为例。</span><br><span class="line"></span><br><span class="line">###  建立项目</span><br><span class="line"></span><br><span class="line">进入[阿里 iconfont](https://www.iconfont.cn/) 寻找你想要添加的图标，并且添加到项目。</span><br><span class="line"></span><br><span class="line">1. 找到你想添加的图标（如果你不会找，可以直接关掉此文了。）</span><br><span class="line"></span><br><span class="line">   将你想要添加的图标点击 “添加入库” 按钮，也就是图中圈起来的图标。</span><br><span class="line"></span><br><span class="line">2. 添加至项目</span><br><span class="line"></span><br><span class="line">   点击右上角小购物车图标。这里会看到你刚刚添加的所有图标</span><br><span class="line"></span><br><span class="line">   接下来就是为你的图标创建一个项目，名称随意。创建完成后你将看到如下页面</span><br><span class="line"></span><br><span class="line">3. 生成在线链接</span><br><span class="line"></span><br><span class="line">   （font class 方式）点击 Font class 按钮然后生成链接。</span><br><span class="line"></span><br><span class="line">   如果使用 svg，那么请点击 symbol，然后生成链接。</span><br><span class="line"></span><br><span class="line">4. 查看链接</span><br><span class="line"></span><br><span class="line">   点击链接会看到一些 css 代码。将鼠标下拉会看到刚才你添加的样式。</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">###  引入字体及样式</span><br><span class="line"></span><br><span class="line">引入字体样式其实就是把刚才的链接引入到博客中，可以直接使用阿里的链接，也可以下载下来。为了方便方便修改，我建议下载下来放到本地。</span><br><span class="line"></span><br><span class="line">同样以 butterfly 主题为例：</span><br><span class="line"></span><br><span class="line">1. 下载</span><br><span class="line"></span><br><span class="line">   右键另存为即可。路径选择 `\themes\Butterfly\source\css\`</span><br><span class="line"></span><br><span class="line">2. 引入文件</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">&gt; 不同主题引入外部 css/js 的方法都不相同，请参考你所使用主题引入外部样式的设置。</span><br><span class="line"></span><br><span class="line">&gt; 如果你不想自己创建而是想直接使用博主的，那么可以直接把链接换成：https://cdn.jsdelivr.net/gh/sviptzk/HexoStaticFile@master/Hexo/css/iconfont.min.css。</span><br><span class="line">&gt;</span><br><span class="line">&gt; 图标库预览：https://www.antmoe.com/iconfont/</span><br><span class="line"></span><br><span class="line">1. 如果使用 svg</span><br><span class="line"></span><br><span class="line">   如果使用 svg 图标，那么需要在 css 样式表中加入如下样式。如果使用 FontClass，那么可以无视这一步</span><br><span class="line"></span><br></pre></td></tr></table></figure>CSS.icon { width: 1em; height: 1em; vertical-align: -0.15em; fill: currentColor; overflow: hidden; }<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">###  开始使用 iconfont</span><br><span class="line"></span><br><span class="line">上述步骤全部完成后，那么接下来可以使用小图标了。</span><br><span class="line"></span><br><span class="line">### 个人信息栏的小图标–font 字体方式</span><br><span class="line"></span><br><span class="line">这里直接写阿里提供的样式即可。</span><br><span class="line"></span><br></pre></td></tr></table></figure>YAMLsocial: iconfont icon-bilibili: https://www.bilibili.com<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">小图标如果你觉得小，可以自行修改。</span><br><span class="line"></span><br></pre></td></tr></table></figure>CSS.icon-bilibili:before { content: "\e600"; /* 修改颜色 */ color: blue; /* 修改大小 */ font-size: 24px; }<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">这样修改会导致所有这个图标的大小都会变动。建议的方式是重新写一个 css，为其添加规则。设置时只需要多加一个 class 即可例如：</span><br><span class="line"></span><br></pre></td></tr></table></figure>CSS.icon-bilibili:before { content: "\e600"; } /* 卡片处小图标 */ .card_icon { /* 修改颜色 */ color: blue; /* 修改大小 */ font-size: 24px; }<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">设置时的方法：</span><br><span class="line"></span><br></pre></td></tr></table></figure>YAMLsocial: iconfont icon-bilibili card_icon: https://www.bilibili.com<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">### 个人信息栏的小图标–svg 方式</span><br><span class="line"></span><br><span class="line">svg 也称多色图标，由于不是通过类名，而是使用了 svg 标签，因此需要通过脚本的方式动态插入。例如：</span><br><span class="line"></span><br></pre></td></tr></table></figure>JAVASCRIPT$(".card-info-social-icons").append( '<a class="social-icon" href="点击图标后的地址（须完整）" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-xxxx"></use></svg></a>' );<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">其中两个空分别表示地址，例如 `https://www.antmoe.com`, 另外一个为图标名，例如`#icon-QQ`，名字根据你自己库来写，不是随便写的。</span><br><span class="line"></span><br><span class="line">### 标题美化处的修改</span><br><span class="line"></span><br><span class="line">butterfly 主题的标题标签前有一个图标，如何为其更改为阿里 iconfont 呢？</span><br><span class="line"></span><br><span class="line">通过开发者工具我们可以看到主题为前边小图标的样式：</span><br><span class="line"></span><br><span class="line">因此我们改动起来也很简单，只需要在刚才我们的 `iconfont.css` 文件中覆盖这个样式即可。</span><br><span class="line"></span><br></pre></td></tr></table></figure>CSS#article-container h1:before,</li></ul><p>#article-container h2:before,<br>#article-container h3:before,<br>#article-container h4:before,<br>#article-container h5:before,<br>#article-container h6:before {<br>font-family: “iconfont”;<br>content: “\e6a0”;<br>}</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">此时就能看到图标已经发生了变化。</span><br><span class="line"></span><br><span class="line">[![img]()](https://cdn.jsdelivr.net/gh/blogimg/picbed@latest/2020/05/07/f4993de6d089f3232aad38ea1bcd8f1f.png)</span><br><span class="line"></span><br><span class="line">&gt; 这里解释下代码，方便大家自行决策如何修改。</span><br><span class="line">&gt;</span><br><span class="line">&gt; `font-family` 是必须写的，因为作者的代码只写了 FontAwesome，因此需要覆盖他。</span><br><span class="line">&gt;</span><br><span class="line">&gt; `content` 可以不在 css 中写，这样可以在配置文件里定义内容。如果写了，会导致配置文件的设置失效。颜色设置同理.</span><br><span class="line"></span><br><span class="line">###  其他修改</span><br><span class="line"></span><br><span class="line">不管是什么主题，不管是什么样式。只要你想使用阿里的图标，必须改变其标签的字体为 `iconfont`, 接下来可以用伪类方式，也可以使用 class 方式。</span><br><span class="line"></span><br><span class="line">文章中使用 svg 也很简单，首先需要确保全局引用了 js。如果没有，在文中局部引入也是可以的。</span><br><span class="line"></span><br><span class="line">接下来只需要在需要的地方插入 svg 标签即可。</span><br><span class="line"></span><br></pre></td></tr></table></figure><p>HTML<svg class="icon" aria-hidden="true"><br><use xlink:href="#icon-xxx"></use><br></svg></p><p>&#96;&#96;&#96;</p><h2 id="最后"><a href="#最后" class="headerlink" title="最后"></a>最后</h2><p>如果你遇到了如下问题，请向上查找解决方案.</p><ol><li><p>修改图标大小及颜色</p></li><li><p>图标不显示 (无效果)</p><p>这种原因很多种，但如果你稍有常识就不会遇到.</p></li><li><p>不知道在哪改</p><p>在你创建的 css 文件中.</p></li></ol></article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">本文作者:</span> <span class="post-copyright-info"><a href="https://www.webxc.ml">XC's Blog</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">本文链接:</span> <span class="post-copyright-info"><a href="https://www.webxc.ml/post/3032259293/">https://www.webxc.ml/post/3032259293/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明:</span> <span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://www.webxc.ml" target="_blank">XC's Blog</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/Hexo/">Hexo</a></div><div class="post_share"><div class="social-share" data-image="https://npm.elemecdn.com/webxc@1.0.0/cover/hexo2.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://npm.elemecdn.com/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload='this.media="all"'><script src="https://npm.elemecdn.com/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><div class="post-reward"><div class="reward-button"><i class="fas fa-qrcode"></i> 打赏</div><div class="reward-main"><ul class="reward-all"><li class="reward-item"><a href="https://npm.elemecdn.com/webxc@1.0.0/lxfs/wechat.png" target="_blank"><img class="post-qr-code-img" src="https://npm.elemecdn.com/webxc@1.0.0/lxfs/wechat.png" alt="Wechat"></a><div class="post-qr-code-desc">Wechat</div></li><li class="reward-item"><a href="https://npm.elemecdn.com/webxc@1.0.0/lxfs/alipay.jpg" target="_blank"><img class="post-qr-code-img" src="https://npm.elemecdn.com/webxc@1.0.0/lxfs/alipay.jpg" alt="Alipay"></a><div class="post-qr-code-desc">Alipay</div></li></ul></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/post/1567310048/"><img class="prev-cover" src="https://npm.elemecdn.com/webxc@1.0.0/cover/markdown.jpg" onerror='onerror=null,src="https://npm.elemecdn.com/webxc@1.0.2/banner/404.gif"' alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇文章</div><div class="prev_info">Markdown高级教程</div></div></a></div><div class="next-post pull-right"><a href="/post/3340407448/"><img class="next-cover" src="https://npm.elemecdn.com/webxc@1.0.0/cover/cover6.jpg" onerror='onerror=null,src="https://npm.elemecdn.com/webxc@1.0.2/banner/404.gif"' alt="cover of next post"><div class="pagination-info"><div class="label">下一篇文章</div><div class="next_info">Hexo博客搭建指南</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><div><a href="/post/34/" title="Hexo Butterfly主题配置"><img class="cover" src="https://npm.elemecdn.com/webxc@1.0.0/cover/cover6.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-09-07</div><div class="title">Hexo Butterfly主题配置</div></div></a></div><div><a href="/post/48588533/" title="使用Hexo和Github搭建个人博客"><img class="cover" src="https://npm.elemecdn.com/webxc@1.0.0/cover/cover4.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-01-05</div><div class="title">使用Hexo和Github搭建个人博客</div></div></a></div><div><a href="/post/7ea9/" title="图床方案汇总"><img class="cover" src="https://npm.elemecdn.com/webxc@1.0.15/cover/hexoimg.webp" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-10-04</div><div class="title">图床方案汇总</div></div></a></div></div></div><hr><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i> <span>评论</span></div></div><div class="comment-wrap"><div><div id="twikoo-wrap"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://npm.elemecdn.com/webxc@1.0.0/logo/logo.jpg" onerror='this.onerror=null,this.src="https://npm.elemecdn.com/webxc@1.0.2/banner/404.gif"' alt="avatar"></div><div class="author-info__name">XC's Blog</div><div class="author-info__description">XC's Blog 记录生活和学习文章</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">74</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">22</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">22</div></a></div><div class="card-info-social-icons is-center"><a class="social-icon" href="https://tenapi.cn/qqzlk/?qq=2848141597" target="_blank" title="QQ"><i class="iconfont icon-QQ"></i></a><a class="social-icon" href="https://npm.elemecdn.com/webxc@1.0.0/lxfs/wechat.jpg" target="_blank" title="微信"><i class="iconfont icon-weixin"></i></a><a class="social-icon" href="https://github.com/web-xc" target="_blank" title="Github"><i class="iconfont icon-github"></i></a><a class="social-icon" href="https://space.bilibili.com/2134826455" target="_blank" title="BiliBili"><i class="iconfont icon-bilibili"></i></a><a class="social-icon" href="https://music.163.com/#/user/home?id=323682437" target="_blank" title="网易云音乐"><i class="iconfont icon-wyy"></i></a></div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#Hexo%E7%9B%B8%E5%85%B3%E7%9A%84%E8%84%9A%E6%9C%AC%EF%BC%9A"><span class="toc-number">1.</span> <span class="toc-text">Hexo相关的脚本：</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%B8%8A%E4%BC%A0%E4%BB%93%E5%BA%93%EF%BC%9A"><span class="toc-number">1.1.</span> <span class="toc-text">上传仓库：</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E5%B0%86D-Hexo-Hexo%E6%94%B9%E4%B8%BA%E8%87%AA%E5%B7%B1%E7%9A%84%E5%8D%9A%E5%AE%A2%E6%A0%B9%E7%9B%AE%E5%BD%95%E5%8D%B3%E5%8F%AF%EF%BC%8C%E9%9A%8F%E5%90%8E%E4%BF%9D%E5%AD%98%E4%B8%BA-bat%E6%96%87%E4%BB%B6"><span class="toc-number">1.1.1.</span> <span class="toc-text">将D:\Hexo\Hexo改为自己的博客根目录即可，随后保存为.bat文件</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%8C%87%E4%BB%A4%E8%AF%B4%E6%98%8E%EF%BC%9A"><span class="toc-number">1.1.2.</span> <span class="toc-text">指令说明：</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%88%B7%E6%96%B0dns%EF%BC%9A"><span class="toc-number">1.2.</span> <span class="toc-text">刷新dns：</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E7%94%B1%E4%BA%8E%E6%9F%90%E4%BA%9B%E6%83%85%E5%86%B5%E5%8F%AF%E8%83%BD%E6%9A%82%E6%97%B6%E6%97%A0%E6%B3%95%E8%AE%BF%E9%97%AEgithub%EF%BC%8C%E9%9C%80%E8%A6%81%E6%9B%B4%E6%94%B9Hosts%EF%BC%8C%E6%9B%B4%E6%94%B9%E5%AE%8C%E9%9C%80%E8%A6%81%E5%88%B7%E6%96%B0DNS%E6%89%8D%E4%BC%9A%E7%94%9F%E6%95%88%EF%BC%8C%E4%BF%9D%E5%AD%98%E4%B8%BA-bat%E6%96%87%E4%BB%B6"><span class="toc-number">1.2.1.</span> <span class="toc-text">由于某些情况可能暂时无法访问github，需要更改Hosts，更改完需要刷新DNS才会生效，保存为.bat文件</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%96%B0%E5%BB%BA%E6%96%87%E7%AB%A0%EF%BC%9A"><span class="toc-number">1.2.2.</span> <span class="toc-text">新建文章：</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%89%93%E5%BC%80%E5%90%8E%E8%BE%93%E5%85%A5%E6%96%87%E7%AB%A0%E5%90%8D%E5%8D%B3%E5%8F%AF%E6%96%B0%E5%BB%BA%E6%96%87%E7%AB%A0%EF%BC%8C%E5%B0%86D-Hexo-Hexo%E6%9B%B4%E6%94%B9%E4%B8%BA%E8%87%AA%E5%B7%B1%E7%9A%84%E5%8D%9A%E5%AE%A2%E6%A0%B9%E7%9B%AE%E5%BD%95%E5%8D%B3%E5%8F%AF%EF%BC%8C%E4%BF%9D%E5%AD%98%E4%B8%BA-sh%E6%96%87%E4%BB%B6"><span class="toc-number">1.2.3.</span> <span class="toc-text">打开后输入文章名即可新建文章，将D:\Hexo\Hexo更改为自己的博客根目录即可，保存为.sh文件</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%9C%AC%E5%9C%B0%E9%A2%84%E8%A7%88%EF%BC%9A"><span class="toc-number">1.3.</span> <span class="toc-text">本地预览：</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E5%B0%86D-Hexo-Hexo%E6%9B%B4%E6%94%B9%E4%B8%BA%E8%87%AA%E5%B7%B1%E7%9A%84%E5%8D%9A%E5%AE%A2%E6%A0%B9%E7%9B%AE%E5%BD%95%E5%8D%B3%E5%8F%AF%EF%BC%8C%E4%BF%9D%E5%AD%98%E4%B8%BA-sh%E6%96%87%E4%BB%B6"><span class="toc-number">1.3.1.</span> <span class="toc-text">将D:\Hexo\Hexo更改为自己的博客根目录即可，保存为.sh文件</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%B8%85%E7%90%86%E7%BC%93%E5%AD%98%EF%BC%9A"><span class="toc-number">1.4.</span> <span class="toc-text">清理缓存：</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E5%B0%86D-Hexo-Hexo%E6%9B%B4%E6%94%B9%E4%B8%BA%E8%87%AA%E5%B7%B1%E7%9A%84%E5%8D%9A%E5%AE%A2%E6%A0%B9%E7%9B%AE%E5%BD%95%E5%8D%B3%E5%8F%AF%EF%BC%8C%E4%BF%9D%E5%AD%98%E4%B8%BA-sh%E6%96%87%E4%BB%B6-1"><span class="toc-number">1.4.1.</span> <span class="toc-text">将D:\Hexo\Hexo更改为自己的博客根目录即可，保存为.sh文件</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%A0%B9%E7%9B%AE%E5%BD%95%EF%BC%9A"><span class="toc-number">1.5.</span> <span class="toc-text">根目录：</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E5%A6%82%E6%9E%9C%E8%A6%81%E8%BF%90%E8%A1%8C%E6%8C%87%E4%BB%A4%E9%9C%80%E8%A6%81%E5%88%B0%E8%B7%9F%E7%9B%AE%E5%BD%95%E5%8F%B3%E9%94%AE%E6%89%93%E5%BC%80git%EF%BC%8C%E7%AE%80%E5%8C%96%E6%93%8D%E4%BD%9C%EF%BC%8C%E4%B8%80%E9%94%AEcd%E5%88%B0%E6%9B%B4%E7%9B%AE%E5%BD%95%E3%80%82%E5%B0%86D-Hexo-Hexo%E6%9B%B4%E6%94%B9%E4%B8%BA%E8%87%AA%E5%B7%B1%E7%9A%84%E5%8D%9A%E5%AE%A2%E6%A0%B9%E7%9B%AE%E5%BD%95%E5%8D%B3%E5%8F%AF%EF%BC%8C%E4%BF%9D%E5%AD%98%E4%B8%BA-sh%E6%96%87%E4%BB%B6"><span class="toc-number">1.5.1.</span> <span class="toc-text">如果要运行指令需要到跟目录右键打开git，简化操作，一键cd到更目录。将D:\Hexo\Hexo更改为自己的博客根目录即可，保存为.sh文件</span></a></li></ol></li></ol></li></ol><li class="toc-item toc-level-2"><a class="toc-link" href="#hexo-butterfly%E7%BE%8E%E5%8C%96%EF%BC%9A"><span class="toc-number"></span> <span class="toc-text">hexo-butterfly美化：</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%A8%B1%E8%8A%B1%E9%A3%98%E8%90%BD%E8%83%8C%E6%99%AF"><span class="toc-number">1.</span> <span class="toc-text">樱花飘落背景</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%B5%8F%E8%A7%88%E5%99%A8%E6%A0%87%E9%A2%98%E6%81%B6%E6%90%9E"><span class="toc-number">2.</span> <span class="toc-text">浏览器标题恶搞</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%B3%A8%E6%84%8F"><span class="toc-number">2.1.</span> <span class="toc-text">注意</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E7%A4%BA%E4%BE%8B"><span class="toc-number">2.2.</span> <span class="toc-text">示例</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%B7%BB%E5%8A%A0%E6%A0%87%E7%AD%BE%E4%BA%91"><span class="toc-number">3.</span> <span class="toc-text">添加标签云</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%B7%BB%E5%8A%A0%E4%B8%AA%E6%80%A7%E5%8C%96%E6%9D%BF%E5%A8%98"><span class="toc-number">4.</span> <span class="toc-text">添加个性化板娘</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%B7%BB%E5%8A%A0%E8%AE%BF%E5%AE%A2%E5%9C%B0%E5%9B%BE"><span class="toc-number">5.</span> <span class="toc-text">添加访客地图</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%A1%B5%E8%84%9A%E8%B7%B3%E5%8A%A8%E7%9A%84%E2%99%A5"><span class="toc-number">6.</span> <span class="toc-text">页脚跳动的♥</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Butterfly%E5%8A%A0%E8%BD%BD%E5%8A%A8%E7%94%BB%E4%BF%AE%E6%94%B9"><span class="toc-number">7.</span> <span class="toc-text">Butterfly加载动画修改</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%BC%95%E5%85%A5%E6%A0%B7%E5%BC%8F%E6%96%87%E4%BB%B6"><span class="toc-number">8.</span> <span class="toc-text">引入样式文件</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%9C%80%E5%90%8E"><span class="toc-number"></span> <span class="toc-text">最后</span></a></li></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/post/us87/" title="JS进阶第二天"><img src="https://npm.elemecdn.com/webxc/cover/js1.webp" onerror='this.onerror=null,this.src="https://npm.elemecdn.com/webxc@1.0.2/banner/404.gif"' alt="JS进阶第二天"></a><div class="content"><a class="title" href="/post/us87/" title="JS进阶第二天">JS进阶第二天</a><time datetime="2023-05-05T01:20:00.000Z" title="发表于 2023-05-05 01:20:00">2023-05-05</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/post/re67/" title="JS进阶第一天"><img src="https://npm.elemecdn.com/webxc/cover/js1.webp" onerror='this.onerror=null,this.src="https://npm.elemecdn.com/webxc@1.0.2/banner/404.gif"' alt="JS进阶第一天"></a><div class="content"><a class="title" href="/post/re67/" title="JS进阶第一天">JS进阶第一天</a><time datetime="2023-04-26T16:30:00.000Z" title="发表于 2023-04-26 16:30:00">2023-04-26</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/post/ar34/" title="Web APIs第七天"><img src="https://cdn1.tianli0.top/gh/web-xc/iMG/postss/webapis.jpg" onerror='this.onerror=null,this.src="https://npm.elemecdn.com/webxc@1.0.2/banner/404.gif"' alt="Web APIs第七天"></a><div class="content"><a class="title" href="/post/ar34/" title="Web APIs第七天">Web APIs第七天</a><time datetime="2023-04-17T20:00:00.000Z" title="发表于 2023-04-17 20:00:00">2023-04-17</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2021 - 2023 By XC's Blog</div><div class="framework-info"><span></span> <a target="_blank" rel="noopener" href="https://icp.gov.moe/?keyword=20235221">萌ICP备20235221号</a><span class="footer-separator">|</span><span></span> <a target="_blank" rel="noopener" href="https://icp.gov.moe/">萌ICP查询</a><div id="running-time"></div></div><script>setInterval((()=>{let e=Math.round(new Date("2021-11-21 01:35:06").getTime()/1e3),t=Math.round(((new Date).getTime()+288e5)/1e3)-e,n=new Array(0,0,0,0,0);t>=31536e3&&(n[0]=parseInt(t/31536e3),t%=31536e3),t>=86400&&(n[1]=parseInt(t/86400),t%=86400),t>=3600&&(n[2]=parseInt(t/3600),t%=3600),t>=60&&(n[3]=parseInt(t/60),t%=60),t>0&&(n[4]=t),currentTimeHtml="本站已安全运行 "+n[0]+" 年 "+n[1]+" 天 "+n[2]+" 时 "+n[3]+" 分 "+n[4]+" 秒",document.getElementById("running-time").innerHTML=currentTimeHtml}),1e3)</script></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i><span id="percent">0<span>%</span></span></button><button id="go-down" type="button" title="直达底部" onclick="btf.scrollToDest(document.body.scrollHeight,500)"><i class="fas fa-arrow-down"></i></button></div></div><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i> <span>正在载入文件,请稍后</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"></div></div><hr><div id="local-search-results"></div></div></div><div id="search-mask"></div></div><div><script src="https://npm.elemecdn.com/hexo-theme-butterfly/source/js/utils.js"></script><script src="https://npm.elemecdn.com/hexo-theme-butterfly@4.4.0/source/js/main.js"></script><script src="https://npm.elemecdn.com/@fancyapps/ui/dist/fancybox.umd.js"></script><script src="https://npm.elemecdn.com/vanilla-lazyload/dist/lazyload.iife.min.js"></script><script src="https://npm.elemecdn.com/node-snackbar/dist/snackbar.min.js"></script><script src="https://npm.elemecdn.com/hexo-theme-butterfly/source/js/search/local-search.js"></script><div class="js-pjax"><script>(()=>{const e=document.querySelectorAll("#article-container .mermaid-wrap");if(e.length){window.runMermaid=()=>{window.loadMermaid=!0;const t="dark"===document.documentElement.getAttribute("data-theme")?"dark":"default";Array.from(e).forEach(((e,n)=>{const d=e.firstElementChild,r="mermaid-"+n,m="%%{init:{ 'theme':'"+t+"'}}%%\n"+d.textContent;mermaid.mermaidAPI.render(r,m,(e=>{d.insertAdjacentHTML("afterend",e)}))}))};const t=()=>{window.loadMermaid?runMermaid():getScript("https://npm.elemecdn.com/mermaid/dist/mermaid.min.js").then(runMermaid)};window.pjax?t():document.addEventListener("DOMContentLoaded",t)}})()</script><script>(()=>{const o=()=>{twikoo.init(Object.assign({el:"#twikoo-wrap",envId:"https://blog2.webxc.ml/",region:"",onCommentLoaded:function(){btf.loadLightbox(document.querySelectorAll("#twikoo .tk-content img:not(.tk-owo-emotion)"))}},null))},t=()=>{"object"!=typeof twikoo?getScript("https://npm.elemecdn.com/twikoo@1.6.10/dist/twikoo.all.min.js").then(o):setTimeout(o,0)};t()})()</script></div><script data-pjax="true" defer src="https://npm.elemecdn.com/webxc@1.0.16/css/style.js"></script><script defer src="https://npm.elemecdn.com/hexo-theme-butterfly@4.4.0/source/js/search/local-search.js"></scrip><script src="https://npm.elemecdn.com/butterfly-extsrc/dist/activate-power-mode.min.js"></script><script>POWERMODE.colorful=!0,POWERMODE.shake=!0,POWERMODE.mobile=!0,document.body.addEventListener("input",POWERMODE)</script><script src="https://npm.elemecdn.com/pjax@0.2.8/pjax.min.js"></script><script>let pjaxSelectors=["head > title","#config-diff","#body-wrap","#rightside-config-hide","#rightside-config-show",".js-pjax",".tk-comments-container"];var pjax=new Pjax({elements:'a:not([target="_blank"])',selectors:pjaxSelectors,cacheBust:!1,analytics:!1,scrollRestoration:!1});document.addEventListener("pjax:send",(function(){if(window.tocScrollFn&&window.removeEventListener("scroll",window.tocScrollFn),window.scrollCollect&&window.removeEventListener("scroll",scrollCollect),"object"==typeof preloader&&preloader.initLoading(),document.getElementById("rightside").style.cssText="opacity: ''; transform: ''",window.aplayers)for(let e=0;e<window.aplayers.length;e++)window.aplayers[e].options.fixed||window.aplayers[e].destroy();"object"==typeof typed&&typed.destroy();const e=document.body.classList;e.contains("read-mode")&&e.remove("read-mode"),"object"==typeof disqusjs&&disqusjs.destroy()})),document.addEventListener("pjax:complete",(function(){window.refreshFn(),document.querySelectorAll("script[data-pjax]").forEach((e=>{const t=document.createElement("script"),o=e.text||e.textContent||e.innerHTML||"";Array.from(e.attributes).forEach((e=>t.setAttribute(e.name,e.value))),t.appendChild(document.createTextNode(o)),e.parentNode.replaceChild(t,e)})),GLOBAL_CONFIG.islazyload&&window.lazyLoadInstance.update(),"function"==typeof chatBtnFn&&chatBtnFn(),"function"==typeof panguInit&&panguInit(),"function"==typeof gtag&&gtag("config","",{page_path:window.location.pathname}),"object"==typeof _hmt&&_hmt.push(["_trackPageview",window.location.pathname]),"function"==typeof loadMeting&&document.getElementsByClassName("aplayer").length&&loadMeting(),"object"==typeof Prism&&Prism.highlightAll(),"object"==typeof preloader&&preloader.endLoading()})),document.addEventListener("pjax:error",(e=>{404===e.request.status&&pjax.loadUrl("/404.html")}))</script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><script data-pjax>function butterfly_swiper_injector_config(){var s=document.getElementById("recent-posts");console.log("已挂载butterfly_swiper"),s.insertAdjacentHTML("afterbegin",'<div class="recent-post-item" style="height: auto;width: 100%"><div class="blog-slider swiper-container-fade swiper-container-horizontal" id="swiper_container"><div class="blog-slider__wrp swiper-wrapper" style="transition-duration: 0ms;"><div class="blog-slider__item swiper-slide" style="background:url(https://cdn1.tianli0.top/gh/web-xc/iMG/postss/webapis.jpg);border-radius:12px;opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><div class="blog-slider__content"><span class="blog-slider__code">2023-04-11</span><a class="blog-slider__title" onclick="pjax.loadUrl(&quot;post/fr67/&quot;);" href="javascript:void(0);" alt="">Web APIs第六天</a><div class="blog-slider__text">点击查看</div></div></div><div class="blog-slider__item swiper-slide" style="background:url(https://npm.elemecdn.com/webxc/cover/js1.webp);border-radius:12px;opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><div class="blog-slider__content"><span class="blog-slider__code">2023-02-16</span><a class="blog-slider__title" onclick="pjax.loadUrl(&quot;post/fd38/&quot;);" href="javascript:void(0);" alt="">JavaScript 第五天</a><div class="blog-slider__text">点击查看</div></div></div><div class="blog-slider__item swiper-slide" style="background:url(https://npm.elemecdn.com/webxc/cover/js1.webp);border-radius:12px;opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><div class="blog-slider__content"><span class="blog-slider__code">2023-02-07</span><a class="blog-slider__title" onclick="pjax.loadUrl(&quot;post/7f86/&quot;);" href="javascript:void(0);" alt="">JavaScript 第四天</a><div class="blog-slider__text">点击查看</div></div></div><div class="blog-slider__item swiper-slide" style="background:url(https://npm.elemecdn.com/webxc/cover/js1.webp);border-radius:12px;opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><div class="blog-slider__content"><span class="blog-slider__code">2022-12-27</span><a class="blog-slider__title" onclick="pjax.loadUrl(&quot;post/6e+47/&quot;);" href="javascript:void(0);" alt="">JavaScript 第三天</a><div class="blog-slider__text">点击查看</div></div></div><div class="blog-slider__item swiper-slide" style="background:url(https://npm.elemecdn.com/webxc@1.0.12/cover/cover15.jpg);border-radius:12px;opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><div class="blog-slider__content"><span class="blog-slider__code">2022-10-31</span><a class="blog-slider__title" onclick="pjax.loadUrl(&quot;post/2db5/&quot;);" href="javascript:void(0);" alt="">移动开发-Flex布局</a><div class="blog-slider__text">点击查看</div></div></div><div class="blog-slider__item swiper-slide" style="background:url(https://npm.elemecdn.com/webxc@1.0.12/cover/cover16.jpg);border-radius:12px;opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><div class="blog-slider__content"><span class="blog-slider__code">2022-11-14</span><a class="blog-slider__title" onclick="pjax.loadUrl(&quot;post/1c7e/&quot;);" href="javascript:void(0);" alt="">移动开发-媒体查询</a><div class="blog-slider__text">点击查看</div></div></div><div class="blog-slider__item swiper-slide" style="background:url(https://npm.elemecdn.com/webxc@1.0.12/cover/cover17.jpg);border-radius:12px;opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><div class="blog-slider__content"><span class="blog-slider__code">2022-11-17</span><a class="blog-slider__title" onclick="pjax.loadUrl(&quot;post/7fc/&quot;);" href="javascript:void(0);" alt="">移动开发-响应式</a><div class="blog-slider__text">点击查看</div></div></div><div class="blog-slider__item swiper-slide" style="background:url(https://npm.elemecdn.com/webxc@1.0.11/cover/css5.jpg);border-radius:12px;opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><div class="blog-slider__content"><span class="blog-slider__code">2022-10-16</span><a class="blog-slider__title" onclick="pjax.loadUrl(&quot;post/d97/&quot;);" href="javascript:void(0);" alt="">CSS-2D-3D转换</a><div class="blog-slider__text">点击查看</div></div></div></div><div class="blog-slider__pagination swiper-pagination-clickable swiper-pagination-bullets"></div><div class="swiper-button-prev"></div><div class="swiper-button-next"></div></div></div>')}for(var elist="null".split(","),cpage=location.pathname,epage="all",flag=0,i=0;i<elist.length;i++)cpage.includes(elist[i])&&flag++;("all"===epage&&0==flag||epage===cpage)&&butterfly_swiper_injector_config()</script><script defer src="https://npm.elemecdn.com/webxc@1.0.12/css/swiper/swiper.min.js"></script><script defer data-pjax src="https://npm.elemecdn.com/webxc@1.0.12/css/swiper/swiper_init.js"></script></body></html>